g_object_unref (builder);
}
+static void
+update_header (GtkListBoxRow *row,
+ GtkListBoxRow *before,
+ gpointer data)
+{
+ if (before != NULL &&
+ gtk_list_box_row_get_header (row) == NULL)
+ {
+ GtkWidget *separator;
+
+ separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_show (separator);
+ gtk_list_box_row_set_header (row, separator);
+ }
+}
+
static void
activate (GApplication *app)
{
adj = (GtkAdjustment *) gtk_builder_get_object (builder, "adjustment2");
g_signal_connect (adj, "value-changed", G_CALLBACK (spin_value_changed), widget);
+ widget = (GtkWidget *)gtk_builder_get_object (builder, "listbox");
+ gtk_list_box_set_header_func (GTK_LIST_BOX (widget), update_header, NULL, NULL);
+
gtk_widget_show_all (GTK_WIDGET (window));
g_object_unref (builder);
</item>
</section>
</menu>
- <menu id='gear_menu'>
+ <menu id="gear_menu">
<section>
<item>
- <attribute name='label' translatable='yes'>Dark Theme</attribute>
- <attribute name='action'>win.dark</attribute>
+ <attribute name="label" translatable="yes">Dark Theme</attribute>
+ <attribute name="action">win.dark</attribute>
</item>
</section>
</menu>
<property name="top-attach">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkListBox" id="listbox">
+ <property name="visible">True</property>
+ <property name="selection-mode">none</property>
+ <child>
+ <object class="GtkBox" id="listboxrow1">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label">Row 1</property>
+ <property name="halign">start</property>
+ <property name="margin">6</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch">
+ <property name="visible">True</property>
+ <property name="margin">6</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="listboxrow2">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label">Row 2</property>
+ <property name="halign">start</property>
+ <property name="margin">6</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScale">
+ <property name="orientation">horizontal</property>
+ <property name="visible">True</property>
+ <property name="margin">6</property>
+ <property name="draw-value">False</property>
+ <property name="width-request">150</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="listboxrow3">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label">Row 3</property>
+ <property name="halign">start</property>
+ <property name="margin">6</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ </packing>
+ </child>
</object>
</child>
</object>
</object>
</child>
</object>
+ <object class="GtkSizeGroup">
+ <property name="mode">vertical</property>
+ <widgets>
+ <widget name="listboxrow1"/>
+ <widget name="listboxrow2"/>
+ <widget name="listboxrow3"/>
+ </widgets>
+ </object>
</interface>